import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

import '../theme/custom_color.dart';

showSuccessToast(BuildContext context, String message,
    {Toast toastLength = Toast.LENGTH_SHORT}) {
  var customColors = Theme.of(context).extension<CustomColors>()!;
  Fluttertoast.showToast(
    msg: message,
    toastLength: toastLength,
    backgroundColor: customColors.successContainer,
    textColor: customColors.onSuccessContainer,
  );
}

showErrorToast(BuildContext context, String message,
    {Toast toastLength = Toast.LENGTH_LONG}) {
  var theme = Theme.of(context);
  Fluttertoast.showToast(
    msg: message,
    toastLength: toastLength,
    backgroundColor: theme.colorScheme.errorContainer,
    textColor: theme.colorScheme.onErrorContainer,
  );
}
